<%@page import="java.util.TreeMap"%>
<%@page import="helpers.UrlHelper"%>
<%@page import="entities.Domain"%>
<%
String name = (String) request.getAttribute("name");
Domain domain = (Domain) request.getAttribute("domain");
TreeMap check = (TreeMap) request.getAttribute("check");

//Set content for seo
String title = "Position Google Ranking Keyword for " + name;
String description = "Ranking positions for " + name + ", this is result analyze " + name + " website ranking position in Google ";
String keywords = name + ",keyword ranking,keyword ranking position,keyword position,google keyword ranking,keyword ranking analytics,keyword ranking analysis,keyword analysis";
String url = UrlHelper.getServerUrl(request) + "/d/" + name;
String ogimage = "http://immediatenet.com/t/t_a?Size=1024x768&URL=" + name;
%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<jsp:include page="/layouts/header.jsp">
	<jsp:param name="title" value="<%=title %>" />
    <jsp:param name="description" value="<%=description %>" />
    <jsp:param name="keywords" value="<%=keywords %>" />
    <jsp:param name="ogtitle" value="<%=title %>" />
    <jsp:param name="ogurl" value="<%=url %>" />
    <jsp:param name="ogimage" value="<%=ogimage %>" />
    <jsp:param name="ogdescription" value="<%=description%>" />
</jsp:include>

	<jsp:include page="/elements/top.jsp" />

<section id="main">
	<div class="container">
		<div class="row-fluid">
			<div class="span8">
			<% if (domain != null) { %>
				<section class="keyword-result">
					<h3><a href="/out/<%=domain.getDomain() %>"><%=domain.getDomain() %></a> Ranking Analysis</h3>
					<div class="adv left">
						<script type="text/javascript"><!--
						google_ad_client = "ca-pub-4975603569119809";
						/* showdomain 468x60 */
						google_ad_slot = "3934035319";
						google_ad_width = 468;
						google_ad_height = 60;
						//-->
						</script>
						<script type="text/javascript"
						src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
						</script>
					</div>
					
					<div class="content-block">
						<% if (domain.getPositionContent().isEmpty()) { %>
						<div class="row-fluid f-info">
							<div class="span12">
								Sorry, we currently do not collect enough data for <%=domain.getDomain() %>.
							</div>
						</div>
						<% } else { %>
						<script type="text/javascript" src="http://www.google.com/jsapi"></script>
						<script type="text/javascript">
						<%=domain.getChartJs() %>
						</script>
						
						<div class="row-fluid f-info">
							<div class="span12">
								<h4><%=domain.getDomain() %> Ranking Position Analysis</h4>
								
								<div class="adv left">
									<script type="text/javascript"><!--
									google_ad_client = "ca-pub-4975603569119809";
									/* traceip_468x15 */
									google_ad_slot = "6636286518";
									google_ad_width = 468;
									google_ad_height = 15;
									//-->
									</script>
									<script type="text/javascript"
									src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
									</script>
								</div>
								
								<ul>
									<li>
										<div id="chart_div_pie"></div>
									</li>
									<li>
										<br />
										<%=domain.getPositionContent() %>
									</li>
								</ul>
								<br />
								<div class="adv left">
									<script type="text/javascript"><!--
									google_ad_client = "ca-pub-4975603569119809";
									/* showdomain 468x60 */
									google_ad_slot = "3934035319";
									google_ad_width = 468;
									google_ad_height = 60;
									//-->
									</script>
									<script type="text/javascript"
									src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
									</script>
								</div>
								
								<h4><%=domain.getDomain() %> domains by time</h4>
								
								<div class="adv left">
									<script type="text/javascript"><!--
									google_ad_client = "ca-pub-4975603569119809";
									/* traceip_468x15 */
									google_ad_slot = "6636286518";
									google_ad_width = 468;
									google_ad_height = 15;
									//-->
									</script>
									<script type="text/javascript"
									src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
									</script>
								</div>
								
								<ul>
									<li>
										<div id="chart_div_line"></div>
									</li>
								</ul>
								
								<br />
								
								<h4>Best of 1 positions for <%=domain.getDomain() %></h4>
								<div class="adv left">
									<script type="text/javascript"><!--
									google_ad_client = "ca-pub-4975603569119809";
									/* traceip_468x15 */
									google_ad_slot = "6636286518";
									google_ad_width = 468;
									google_ad_height = 15;
									//-->
									</script>
									<script type="text/javascript"
									src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
									</script>
								</div>
								
								<ul>
									<li>
										<%=domain.getBest1position() %>
									</li>
								</ul>
								
								<h4>Best of 2-5 positions for <%=domain.getDomain() %></h4>
								<ul>
									<li>
										<%=domain.getBest2positions() %>
									</li>
								</ul>
								
								<h4>Best of 6-10 positions for <%=domain.getDomain() %></h4>
								<ul>
									<li>
										<%=domain.getBest10positions() %>
									</li>
								</ul>
							</div>
						</div>
						<% } %>
					</div>
				</section>
				<% } %>
			</div>
			
			<jsp:include page="/elements/right.jsp" />
		</div>
	</div>
</section>

<jsp:include page="/layouts/footer.jsp" />	